const { connection } = require('../../../model/database')
module.exports = (req, res) => {
    var sql = 'select count(*) as count from article'
    // 发送
    connection.query(sql, (error, reslut) => {
        if (error) {
            res.status(400).send('错误')
            return
        }
        var num = Math.ceil(reslut[0].count / 10)
        var page = []
        for (var i = 0; i < num ; i++) {
            var obj = {
                page:i
            }
            page.push(obj)
        }
        res.send(page)
    })
}